import request from '@/config/axios'

export interface ReceiveDataVO {
  followStatus: boolean
  lastFollowRecord: string
  lastFollowTime: Date
  tags: string
}

// 查询领取列表分页
export const getReceiveDataPage = async (params) => {
  return await request.get({ url: `/ent/receive-data/page`, params })
}

// 查询领取列表详情
export const getReceiveData = async (id: number) => {
  return await request.get({ url: `/ent/receive-data/get?id=` + id })
}

// 新增领取列表
export const createReceiveData = async (data: ReceiveDataVO) => {
  return await request.post({ url: `/ent/receive-data/create`, data })
}

// 修改领取列表
export const updateReceiveData = async (data: ReceiveDataVO) => {
  return await request.put({ url: `/ent/receive-data/update`, data })
}

// 删除 放回公海
export const deleteReceiveData = async (id: number) => {
  return await request.delete({ url: `/ent/receive-data/delete?id=` + id })
}
// 批量放入公海
export const deleteBatchData = async (arr) => {
  return await request.delete({
    url: `/ent/receive-data/batch-delete`,
    params: { idList: arr.join(',') }
  })
}

// 导出领取列表 Excel
export const exportReceiveData = async (params) => {
  return await request.download({ url: `/ent/receive-data/export-excel`, params })
}

// 查询标签
export const getSimpleList = async () => {
  return await request.get({ url: `/ent/tag/simple-list` })
}

// 修改编辑
export const updateReceiveNumber = async (data) => {
  return await request.put({ url: '/ent/receive-number/update', data })
}
